Skip to content

Conversation

@github-actions
Copy link

Which issue(s) this PR fixes:
Backport #5228
Fixes #

Ref. #5100

What this PR does / why we need it:
Currently, if a user explicitly @includes a file that is also located
in config_include_dir, the file is loaded twice.
This causes startup failures due to port conflicts or ID duplication.

This commit introduces a deduplication mechanism using a callback:

  1. Add on_file_parsed callback to Fluent::Config.build to track files loaded during the user config parsing phase.
  2. In Supervisor, record loaded files via this callback.
  3. When expanding config_include_dir, skip files that have already been loaded in the user configuration.

Docs Changes:

Release Note:

**Which issue(s) this PR fixes**:
Fixes #

Ref. https://github.com/fluent/fluentd/discussions/5100

**What this PR does / why we need it**:
Currently, if a user explicitly `@include`s a file that is also located
in `config_include_dir`, the file is loaded twice.
This causes startup failures due to port conflicts or ID duplication.

This commit introduces a deduplication mechanism using a callback:

1. Add `on_file_parsed` callback to `Fluent::Config.build` to track
files loaded during the user config parsing phase.
2. In `Supervisor`, record loaded files via this callback.
3. When expanding `config_include_dir`, skip files that have already
been loaded in the user configuration.

**Docs Changes**:

**Release Note**:

---------

Signed-off-by: Shizuo Fujita <fujita@clear-code.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@kenhys kenhys merged commit 019bc6b into v1.19 Jan 26, 2026
1 check passed
@kenhys kenhys deleted the backport-to-v1.19/pr5228 branch January 26, 2026 01:15
@kenhys kenhys added this to the v1.19.2 milestone Jan 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants